import { Action, CopyComponents, Drawer, Footer } from '@/components';
import Guide from '@/components/Guide';
import { trim } from '@/utils/format';
import { PageContainer } from '@ant-design/pro-components';
import { useModel } from '@umijs/max';
import { useRef } from 'react';
import styles from './index.less';

const HomePage: React.FC = () => {
  const { name } = useModel('global');
  const drawerRef = useRef<any>(null);
  return (
    <PageContainer ghost>
      <div className={styles.container}>
        <Guide name={trim(name)} />
      </div>
      <Action
        confirm="确定？"
        action={() => {
          console.log('走了');
          drawerRef?.current?.show();
        }}
      >
        action按钮
      </Action>
      <div>
        123456789 <CopyComponents value="123456789" />
      </div>

      <Drawer ref={drawerRef}></Drawer>
      <Footer></Footer>
    </PageContainer>
  );
};

export default HomePage;
